
package matchingPLS2TF;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;


public class Main2FlickrData3 {

	public static void main (String [] args) throws Exception{
		//continene tutti gli utenti  
		List<FlickrUser> f = new ArrayList<FlickrUser>();
		FlickrUserMethods.loadFlickrUser3(f, "TO_bbox/TwitterUsers3EventsTS2.csv");
		
		Collections.sort(f);
		
		for (int i = 0; i < f.size(); i++) {
			System.out.println(f.get(i).toString());
		}
	    Map<FlickrUser, List<PLSUser>>	data = new HashMap<FlickrUser, List<PLSUser>>();
		List<PLSUser> pls_user ;
		for (int i = 0; i < f.size(); i++) {
			System.out.println(f.get(i).username);
		}
		Collections.sort(f);
		//FlickrUserMethods.printUserTsAndCoord("FlickrUsersTsAndCoord.csv", f);
	
		for (int i = 0; i < f.size(); i++) {	
		
			//pls_user = new ArrayList<PLSUser>();
			if((f.size() -(i+1))==0){
				break;
			}
			String username_i1 = f.get(i+1).username;
			String username_i = f.get(i).username;
			
			System.out.println(username_i);
			
				double fl_lat = f.get(i).lat;
				double fl_lon = f.get(i).lon;
				
				System.out.println("***********"+fl_lat+", "+fl_lon);
				long ts_flickr_user = f.get(i).timest;
				pls_user = new ArrayList<PLSUser>();
				System.out.println("****** "+f.get(i).username+" ha timestamp = "+ts_flickr_user);
				pls_user = FlickrUserMethods.ts_pls_list4FlickrUser("C:/DATA/data/mese/AllData",
						fl_lat, fl_lon, ts_flickr_user);
				
				data.put(f.get(i), pls_user);
				
				if(!(username_i.equals(username_i1))){
				FlickrUserMethods.print("Twitter2PLSResults_"+username_i+", "+i+"_10min.txt", data);
				data = new HashMap<FlickrUser, List<PLSUser>>();
				}
			}
    }
}
